package com.zyd.blog.homeart.util;

import java.util.HashMap;
import java.util.Map;

/**
 * 全局系统响应信息
 *
 * @author loop  
 */
public class ResponseCode {

    /**
     * 访问的地址不存在
     */
    public static final int SUCCESS = 200;

    /**
     * 访问的地址不存在
     */
    public static final int ADDRESS_ERROR = 404;
    /**
     * 请求方式不支持
     */
    public static final int POST_ERROR = 405;
    /**
     * 系统错误
     */
    public static final int SYSTEM_ERROR = 500;
    /**
     * 权限拒绝
     */
    public static final int TOEKN_ERROR = 502;
    /**
     * 签名错误
     */
    public static final int SIGN_ERROR = 503;
    /**
     * 接口调用失败
     */
    public static final int CODE_FAILED = 0;
    /**
     * 接口调用成功
     */
    public static final int CODE_SUCCESS = 1;
    /**
     * 接口请求限制
     */
    public static final int ACCESS_LIMIT = 1001;
    /**
     * 用户已被锁定
     */
    public static final int USER_LOCK = 1002;
    /**
     * 手机号未绑定
     */
    public static final int NOT_BIND = 1003;
    /**
     * 用户不存在
     */
    public static final int NOT_EXIST = 1004;
    /**
     * 用户手机号不存在
     */
    public static final int NOT_PHONE_EXIST = 1005;

    public static final Map<Integer, String> RESP_INFO = new HashMap<>();

    static {
        RESP_INFO.put(ADDRESS_ERROR, "访问的地址不存在");
        RESP_INFO.put(POST_ERROR, "请求方式不支持");
        RESP_INFO.put(SYSTEM_ERROR, "系统错误");
        RESP_INFO.put(TOEKN_ERROR, "系统错误，权限拒绝");
        RESP_INFO.put(SIGN_ERROR, "签名错误");
        RESP_INFO.put(CODE_FAILED, "接口调用失败");
        RESP_INFO.put(CODE_SUCCESS, "接口调用成功");
        RESP_INFO.put(ACCESS_LIMIT, "接口请求限制");
        RESP_INFO.put(USER_LOCK, "用户已被锁定");
        RESP_INFO.put(NOT_BIND, "手机号未绑定");
        RESP_INFO.put(NOT_EXIST, "用户不存在");
        RESP_INFO.put(NOT_PHONE_EXIST, "用户手机号不存在");
    }

    public static void main(String[] args) {
        System.out.println(ResponseCode.SYSTEM_ERROR);
        System.out.println(ResponseCode.RESP_INFO.get(SYSTEM_ERROR));
    }

}
